DESCRIPTION = "A high performance JSON library written in ANSI C."
HOMEPAGE = "https://github.com/ibireme/yyjson"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c8ae1b99922935413d4c596f50b59545"

SRC_URI = "git://github.com/ibireme/yyjson.git;protocol=https;branch=master;tag=${PV}"
SRCREV = "9e24d6bcead647231f81173cc5c6bb6c097c00e4"

S = "${WORKDIR}/git"

inherit cmake

PACKAGECONFIG ??= "reader writer utils fast-fp-conv non-standard utf8-validation unaligned-memory-access"
PACKAGECONFIG[reader] = "-DYYJSON_DISABLE_READER=OFF,-DYYJSON_DISABLE_READER=ON"
PACKAGECONFIG[writer] = "-DYYJSON_DISABLE_WRITER=OFF,-DYYJSON_DISABLE_WRITER=ON"
PACKAGECONFIG[utils] = "-DYYJSON_DISABLE_UTILS=OFF,-DYYJSON_DISABLE_UTILS=ON"
PACKAGECONFIG[fast-fp-conv] = "-DYYJSON_DISABLE_FAST_FP_CONV=OFF,-DYYJSON_DISABLE_FAST_FP_CONV=ON"
PACKAGECONFIG[non-standard] = "-DYYJSON_DISABLE_NON_STANDARD=OFF,-DYYJSON_DISABLE_NON_STANDARD=ON"
PACKAGECONFIG[utf8-validation] = "-DYYJSON_DISABLE_UTF8_VALIDATION=OFF,-DYYJSON_DISABLE_UTF8_VALIDATION=ON"
PACKAGECONFIG[unaligned-memory-access] = "-DYYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS=OFF,-DYYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS=ON"

EXTRA_OECMAKE:append = " \
-DBUILD_SHARED_LIBS=ON \
-DYYJSON_BUILD_TESTS=OFF \
-DYYJSON_BUILD_FUZZER=OFF \
-DYYJSON_BUILD_MISC=OFF \
-DYYJSON_BUILD_DOC=OFF \
-DYYJSON_ENABLE_COVERAGE=OFF \
-DYYJSON_ENABLE_VALGRIND=OFF \
-DYYJSON_ENABLE_SANITIZE=OFF \
-DYYJSON_ENABLE_FASTMATH=OFF \
-DYYJSON_FORCE_32_BIT=OFF \
"
